/*
 * @Author: huzhanglin 799490931@qq.com
 * @Date: 2023-12-18 07:30:19
 * @LastEditors: huzhanglin 799490931@qq.com
 * @LastEditTime: 2023-12-24 09:20:12
 * @FilePath: \my-app01\src\app\myc01\myc01.component.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { CurrencyPipe, DatePipe } from '@angular/common';
import { HttpClient } from '@angular/common/http';
import { Component, OnChanges, SimpleChanges, ViewChild } from '@angular/core';

@Component({
  selector: 'app-myc01',
  standalone: true,
  imports: [CurrencyPipe, DatePipe],
  templateUrl: './myc01.component.html',
  styleUrl: './myc01.component.css',
})
export class Myc01Component implements OnChanges {
  private _date: Date = new Date();
  public get date(): Date {
    return this._date;
  }
  public set date(value: Date) {
    this._date = value;
  }
  http;
  constructor(http: HttpClient) {
    this.http = http;
  }

  ngOnInit(): void {
    this.http.get('http://localhost:8080/user').subscribe((res) => {
      console.log(res);
    });
  }

  ngOnChanges(changes: SimpleChanges): void {
    //Called before any other lifecycle hook. Use it to inject dependencies, but avoid any serious work here.
    //Add '${implements OnChanges}' to the class.
  }
}
